package org.ithang.application.msg.service;

import java.util.List;
import java.util.Map;
import org.ithang.application.msg.mapper.MsgMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.log4j.Logger;
import org.ithang.tools.model.Pager;
import org.ithang.tools.database.ModelDao;
import org.ithang.application.msg.bean.Msg;

/**
 * 站内留言 服务
 * @author zyt
 *
 */
@Service
public class MsgService extends ModelDao<Msg>{

    @Autowired
    private MsgMapper msgMapper;

    private Logger logger = Logger.getLogger(MsgService.class);
    
    public void add(Msg msg){
        msgMapper.add(msg);
    }
    
    public Msg get(Long id){
        return msgMapper.get(id);
    }
    
    public int delete(Long id){
        return msgMapper.delete(id);
    }
    
    public int batchDelete(String[] ids){
    	return msgMapper.batchDelete(ids);
    }
    
    public List<Msg> list(Long... ids){
    	return msgMapper.list(ids);
    }
    
    public List<Msg> page(Pager<Msg> page){
    	return msgMapper.page(page);
    }
    
    public List<Msg> query(Map<String,Object> conditions){
    	return msgMapper.query(conditions);
    }
    
    public int update(Msg msg){
    	return msgMapper.update(msg);
    }
    
    
}